<?php
declare (strict_types = 1);

namespace app\move\controller;

use app\move\model\Goods;
use app\move\MoveController;
use app\move\services\GoodsServices;
use app\Request;

class Index extends MoveController
{
    public function index()
    {
        return view('index');
    }
    public function list(){
        return view('list');
    }

    public function show(Request $request){
        $cate_id=$request->get('cid',0,'intval');

        $goods=GoodsServices::goodsList([
            'cate_id'=>$cate_id
        ]);
//        dd($goods->toArray());
        return view('index/list',compact('goods'));
    }
    public function item(Request $request){
        $good_id=$request->get('gid',0,'intval');
        $goods=GoodsServices::detail($good_id);
//        dd($goods);
        return view('item',compact('goods'));
    }
}
